﻿using Monkey.Warrenty.Data;
using Monkey.Warrenty.Data.Interfaces;

namespace Monkey.Warrenty.Biz
{
    public class StatisticBiz
    {
        private static IWarrantyTicketDao _warrantyTicketDao;
        private static IWarrantyTicketDao WarrantyTicketData
        {
            get
            {
                return _warrantyTicketDao ?? (_warrantyTicketDao = new WarrantyTicketDao());
            }
        }

        private static IWarrantyProductDao _warrantyProductDao;
        private static IWarrantyProductDao WarrantyProductData
        {
            get
            {
                return _warrantyProductDao ?? (_warrantyProductDao = new WarrantyProductDao());
            }
        }

        public static int CountWarrantyTickets(int status)
        {
            return WarrantyTicketData.GetTicketCountByFilter(status);
        }

        public static int CountProcessingProducts()
        {
            return WarrantyProductData.GetProcessingWarrantyProductsCount();
        }

        public static int CountReceivedProducts()
        {
            return WarrantyProductData.GetReceivedWarrantyProductsCount();
        }
    }
}
